/*
 * @Author: your name
 * @Date: 2021-06-07 13:51:37
 * @LastEditTime: 2021-06-08 16:20:27
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \bazai_ebook\src\utils\common.js
 */
/**
 *@param: app > createApp(App)
 *@description: 全局注册组件
 *@author: Mister Wang
 *@date: 2021-06-05 17:36:26
*/
const registerComponent = (app) => {
  const componentsContext = require.context('_c', true, /.vue$/)
  componentsContext.keys().forEach(component => {
    const componentConfig = componentsContext(component).default
    app.component(componentConfig.name, componentConfig)
  })
  return app
}

export {
  registerComponent
}
